<template>
  <div ref="target" class="home-banner">
    <XtxCarousel :sliders="sliders" />
  </div>
</template>
<script>
import { findBanner } from '@/api/home'
import { useLazyData } from '@/hooks'
export default {
  name: 'HomeBanner',
  setup() {
    /*  const sliders = ref([])
     findBanner().then(data => {
       sliders.value = data.result
     }) */
    const { target, result } = useLazyData(findBanner)
    return { target, sliders: result }
  }
}
</script>
<style scoped lang="less">
// 定制该组件的轮播图样式
.xtx-carousel {
  ::v-deep .carousel-btn.prev {
    left: 270px !important;
  }

  ::v-deep .carousel-indicator {
    padding-left: 250px;
  }
}

.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98
}
</style>